package com.platagalicia.web.controller;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import com.platagalicia.exception.BusinessException;

/**
 * Controller base
 * @author oscarha
 *
 */
public class BaseController extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	/**
	 * Obtiene un valor del request.
	 * @param str
	 * @return
	 */
	public String getParam(HttpServletRequest req, String key) throws BusinessException{
		String val = req.getParameter(key.trim());
		if(val!=null && val.trim().length()>0){
			return val.trim();
		}else{
			return null;
		}
	}
	
}
